#pragma once  //!防止头文件被重复包含
#include "Bsp.h"
#include "ti_msp_dl_config.h"

#define RED(X)                                                          \
  ((X) ? (DL_GPIO_setPins(RGB_PORT, RGB_RED_PIN))                       \
       : (DL_GPIO_clearPins(RGB_PORT, RGB_RED_PIN)))                    

#define BLUE(X)                                                         \
  ((X) ? (DL_GPIO_setPins(RGB_PORT, RGB_BLUE_PIN))                      \
       : (DL_GPIO_clearPins(RGB_PORT, RGB_BLUE_PIN)))

#define GREEN(X)                                                         \
  ((X) ? (DL_GPIO_setPins(RGB_PORT, RGB_GREEN_PIN))                      \
       : (DL_GPIO_clearPins(RGB_PORT, RGB_GREEN_PIN)))

#define BEEP(X)                                                         \
  ((X) ? (DL_GPIO_setPins(BEEP_PORT, BEEP_PIN_0_PIN))                    \
       : (DL_GPIO_clearPins(BEEP_PORT, BEEP_PIN_0_PIN)))


// LED控制抽象层（假设0=亮，1=灭）
#define LED_RED_SET(state)   RED(state)
#define LED_GREEN_SET(state) GREEN(state)
#define LED_BLUE_SET(state)  BLUE(state)

// 颜色枚举定义（避免宏重复，提高类型安全）
typedef enum {
    LED_COLOR_RED = 1,
    LED_COLOR_GREEN,
    LED_COLOR_BLUE,
    LED_COLOR_PURPLE,
    LED_COLOR_YELLOW,
    LED_COLOR_CYAN,
    LED_COLOR_WHITE,
    LED_COLOR_NONE
} LedColor;

void RGB_LED(uint8_t color);
//void Sg(void);
